function PrecacheEveryThingFromKV( context )
    local kv_files = 
    {
	    "scripts/npc/npc_units_custom.txt",
	    "scripts/npc/npc_abilities_custom.txt",
	    "scripts/npc/npc_heroes_custom.txt",
	    "scripts/npc/npc_items_custom.txt"
	}
    for _, kv in pairs(kv_files) do
        local kvs = LoadKeyValues(kv)
        if kvs then
            print("BEGIN TO PRECACHE RESOURCE FROM: ", kv)
            PrecacheEverythingFromTable( context, kvs)
        end
    end
    local sp = 
	{
		"models/props/ice_biome/buildings/tuskhouse01.vmdl",
		"models/props/landing_page/armadillo/armadillo_house.vmdl",
		"models/props/landing_page/armadillo/armadillo_school.vmdl",
		"models/props/landing_page/armadillo/armadillo_church.vmdl",
		"models/props/landing_page/armadillo/armadillo_tower.vmdl",
		"models/props_tree/cornstack/cornstack.vmdl",
		"models/props_gameplay/treasure_chest001.vmdl",
		"models/props_gameplay/rune_point001.vmdl",
		"models/props_cave/mine_cart.vmdl",
		"models/props_gameplay/crown001.vmdl",
		"models/props_structures/dragon_statue001.vmdl",
		"models/props_structures/good_barracks001_destruction.vmdl",
		"models/items/lone_druid/bear_trap/bear_trap.vmdl",
		"models/heroes/rattletrap/rattletrap_cog.vmdl",
	}
	local t = #sp
	for i=1,t do
		PrecacheResource("model", sp[i], context)
		print("PrecacheResource:",sp[i])
	end

	local task_part_ltx = 
	{
		"particles/units/heroes/hero_kunkka/kunkka_spell_torrent_splash_water9b.vpcf",
		"particles/units/heroes/hero_dazzle/dazzle_base_attack.vpcf",
		"particles/units/heroes/hero_huskar/huskar_base_attack.vpcf",
		"particles/units/heroes/hero_invoker/invoker_base_attack.vpcf",
		"particles/units/heroes/hero_lina/lina_base_attack.vpcf",
		"particles/units/heroes/hero_morphling/morphling_base_attack.vpcf",
		"particles/units/heroes/hero_razor/razor_base_attack.vpcf",
		"particles/units/heroes/hero_shadow_demon/shadow_demon_base_attack.vpcf",
		"particles/units/heroes/hero_nevermore/nevermore_base_attack.vpcf",
		"particles/econ/items/sniper/sniper_charlie/sniper_base_attack_bulletcase_charlie.vpcf",
		"particles/units/heroes/hero_tinker/tinker_base_attack.vpcf",
		"particles/units/heroes/hero_windrunner/windrunner_base_attack.vpcf",
		"particles/econ/items/witch_doctor/witch_doctor_ribbitar/witchdoctor_ward_cast_staff_fire_ribbitar_c.vpcf",
		"particles/econ/items/zeus/lightning_weapon_fx/zuus_base_attack_arc_immortal_lightning.vpcf",
		"particles/items_fx/desolator_projectile.vpcf",
		"particles/econ/items/keeper_of_the_light/kotl_weapon_arcane_staff/keeper_base_attack_arcane_staff.vpcf",
		"particles/units/heroes/hero_viper/viper_base_attack.vpcf",
		"particles/econ/events/ti6/hero_levelup_ti6.vpcf",			--accept task particle
		"particles/items2_fx/refresher.vpcf",
		"particles/econ/courier/courier_wyvern_hatchling/courier_wyvern_anim_goldbreath.vpcf",--获得金币
		"particles/ui/hammer_model.vpcf",--强化的锤子
		"particles/rotation.vpcf",
		"particles/dice_1.vpcf",
		"particles/dice_2.vpcf",
		"particles/dice_3.vpcf",
		"particles/dice_4.vpcf",
		"particles/dice_5.vpcf",
		"particles/dice_6.vpcf",
		"particles/units/heroes/hero_invoker/invoker_tornado_funnel.vpcf",
		"particles/econ/items/monkey_king/arcana/water/mk_spring_water_splash.vpcf",
	}

	-- local npart_ltx = #task_part_ltx
	-- for i=1,npart_ltx do
	-- 	PrecacheResource("particle", task_part_ltx[i], context)

	-- 	print("PrecacheResource:",task_part_ltx[i])
	-- end

	local sound_ltx = 
	{
		"soundevents/game_sounds_heroes/game_sounds_omniknight.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_lich.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_chen.vsndevts",
		"soundevents/custom_sound_events.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_phoenix.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_ancient_apparition.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_crystalmaiden.vsndevts",
		"soundevents/voscripts/game_sounds_vo_secretshop.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_earth_spirit.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_ursa.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_earth_spirit.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_stormspirit.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_viper.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_slark.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_lion.vsndevts",
		"soundevents/game_sounds_heroes/game_sounds_batrider.vsndevts",
	}
	local nsound_ltx = #sound_ltx
	for i=1,nsound_ltx do
		PrecacheResource("soundfile", sound_ltx[i], context)
		print("PrecacheResource:",sound_ltx[i])
	end
	
end
 
function PrecacheEverythingFromTable( context, kvtable)
    for key, value in pairs(kvtable) do
        if type(value) == "table" then
            PrecacheEverythingFromTable( context, value )
        else
            if string.find(value, "vpcf") then
                PrecacheResource( "particle",  value, context)
                print("PRECACHE PARTICLE RESOURCE", value)
            end
            if string.find(value, "vmdl") then  
                PrecacheResource( "model",  value, context)
                print("PRECACHE vmdl RESOURCE", value)
            end
            if string.find(value, "vsndevts") then
                PrecacheResource( "soundfile",  value, context)
                print("PRECACHE SOUND RESOURCE", value)
            end
        end
    end    
end